﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using C1.Win.C1Input;
    using Excel;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Reflection;
    using System.Runtime.CompilerServices;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_BaoCaoDoanhThuTheoNhanVien : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("AdvNhanVien")]
        private ADVObjects _AdvNhanVien;
        [AccessedThroughProperty("CmdCancel")]
        private System.Windows.Forms.Button _CmdCancel;
        [AccessedThroughProperty("CmdExel")]
        private System.Windows.Forms.Button _CmdExel;
        [AccessedThroughProperty("CmdLoad")]
        private System.Windows.Forms.Button _CmdLoad;
        [AccessedThroughProperty("CmdPrint")]
        private System.Windows.Forms.Button _CmdPrint;
        [AccessedThroughProperty("Label1")]
        private System.Windows.Forms.Label _Label1;
        [AccessedThroughProperty("Label13")]
        private System.Windows.Forms.Label _Label13;
        [AccessedThroughProperty("Label16")]
        private System.Windows.Forms.Label _Label16;
        [AccessedThroughProperty("Panel1")]
        private Panel _Panel1;
        [AccessedThroughProperty("Panel3")]
        private Panel _Panel3;
        [AccessedThroughProperty("Panel4")]
        private Panel _Panel4;
        [AccessedThroughProperty("TxtDenNgay")]
        private DateTimePicker _TxtDenNgay;
        [AccessedThroughProperty("TxtDoanhThu")]
        private C1NumericEdit _TxtDoanhThu;
        [AccessedThroughProperty("TxtHoaHong")]
        private C1NumericEdit _TxtHoaHong;
        [AccessedThroughProperty("TxtLaiGop")]
        private C1NumericEdit _TxtLaiGop;
        [AccessedThroughProperty("TxtTienChietKhau")]
        private C1NumericEdit _TxtTienChietKhau;
        [AccessedThroughProperty("TxtTienVon")]
        private C1NumericEdit _TxtTienVon;
        [AccessedThroughProperty("TxtTuNgay")]
        private DateTimePicker _TxtTuNgay;
        [AccessedThroughProperty("VSlist")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSlist;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;

        [DebuggerNonUserCode]
        public Frm_BaoCaoDoanhThuTheoNhanVien()
        {
            base.Load += new EventHandler(this.Frm_BaoCaoDoanhThuTheoNhanVien_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.InitializeComponent();
        }

        private void CmdCancel_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdExel_Click(object sender, EventArgs e)
        {
            try
            {
                SaveFileDialog dialog = new SaveFileDialog {
                    Filter = "Excel Files|*.xls",
                    Title = "Save an Excel file"
                };
                dialog.ShowDialog();
                if (dialog.FileName != "")
                {
                    this.VSlist.SaveExcel(dialog.FileName, "DoanhThu", FileFlags.IncludeFixedCells);
                    Excel.Application application = new ApplicationClass();
                    Workbook workbook = application.Workbooks.Open(dialog.FileName, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value);
                    application.Visible = true;
                }
            }
            catch (COMException exception1)
            {
                ProjectData.SetProjectError(exception1);
                COMException exception = exception1;
                MessageBox.Show(exception.Message);
                ProjectData.ClearProjectError();
            }
            catch (Exception exception3)
            {
                ProjectData.SetProjectError(exception3);
                Exception exception2 = exception3;
                MessageBox.Show(exception2.Message);
                ProjectData.ClearProjectError();
            }
        }

        private void CmdLoad_Click(object sender, EventArgs e)
        {
            this.LoadData();
        }

        private void CmdPrint_Click(object sender, EventArgs e)
        {
            this.PrintReport();
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            try
            {
                if (disposing && (this.components != null))
                {
                    this.components.Dispose();
                }
            }
            finally
            {
                base.Dispose(disposing);
            }
        }

        private void Frm_BaoCaoDoanhThuTheoNhanVien_Load(object sender, EventArgs e)
        {
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                this.TxtTuNgay.Text = "01/" + LVYModule.sRight("00" + Conversions.ToString(DateAndTime.Month(DateAndTime.Today)), 2) + "/" + Conversions.ToString(DateAndTime.Year(DateAndTime.Today));
                LVYModule.advFormatNumber(this.TxtDoanhThu, modGeneral.H_FORMATNUMBER);
                LVYModule.advFormatNumber(this.TxtTienChietKhau, modGeneral.H_FORMATNUMBER);
                LVYModule.advFormatNumber(this.TxtHoaHong, modGeneral.H_FORMATNUMBER);
                LVYModule.advFormatNumber(this.TxtTienVon, modGeneral.H_FORMATNUMBER);
                LVYModule.advFormatNumber(this.TxtLaiGop, modGeneral.H_FORMATNUMBER);
                if (modGeneral.H_GIOIHANDULIEU)
                {
                    this.AdvNhanVien.Value = modGeneral.H_USERID;
                    this.AdvNhanVien.ReadOnly = true;
                }
                else
                {
                    this.AdvNhanVien.Value = "";
                    this.AdvNhanVien.ReadOnly = false;
                }
                this.LoadData();
            }
        }

        public System.Data.DataTable GetData()
        {
            System.Data.DataTable table;
            IDataParameter[] commandParameters = new IDataParameter[5];
            try
            {
                commandParameters[0] = DBHelper.createParameter("@TuNgay", DbType.Int64, ParameterDirection.Input, LVYModule.Date2Char(this.TxtTuNgay.Text));
                commandParameters[1] = DBHelper.createParameter("@DenNgay", DbType.Double, ParameterDirection.Input, LVYModule.Date2Char(this.TxtDenNgay.Text));
                commandParameters[2] = DBHelper.createParameter("@KhoaDonVi", DbType.Int64, ParameterDirection.Input, modGeneral.H_CLIENT);
                commandParameters[3] = DBHelper.createParameter("@KhoaNhanVien", DbType.Int64, ParameterDirection.Input, this.AdvNhanVien.Value);
                commandParameters[4] = DBHelper.createParameter("@Language", DbType.Int64, ParameterDirection.Input, modGeneral.H_LANGUAGE);
                table = DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.StoredProcedure, "BH_BC_DoanhThuTheoNhanVien", commandParameters).Tables[0];
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                table = null;
                ProjectData.ClearProjectError();
                return table;
                ProjectData.ClearProjectError();
            }
            return table;
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_BaoCaoDoanhThuTheoNhanVien));
            this.Label16 = new System.Windows.Forms.Label();
            this.Label1 = new System.Windows.Forms.Label();
            this.Panel3 = new Panel();
            this.Panel4 = new Panel();
            this.TxtLaiGop = new C1NumericEdit();
            this.TxtTienVon = new C1NumericEdit();
            this.TxtHoaHong = new C1NumericEdit();
            this.TxtTienChietKhau = new C1NumericEdit();
            this.TxtDoanhThu = new C1NumericEdit();
            this.TxtDenNgay = new DateTimePicker();
            this.Label13 = new System.Windows.Forms.Label();
            this.Panel1 = new Panel();
            this.CmdCancel = new System.Windows.Forms.Button();
            this.CmdExel = new System.Windows.Forms.Button();
            this.CmdPrint = new System.Windows.Forms.Button();
            this.CmdLoad = new System.Windows.Forms.Button();
            this.AdvNhanVien = new ADVObjects();
            this.TxtTuNgay = new DateTimePicker();
            this.VSlist = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.Panel3.SuspendLayout();
            this.Panel4.SuspendLayout();
            ((ISupportInitialize) this.TxtLaiGop).BeginInit();
            ((ISupportInitialize) this.TxtTienVon).BeginInit();
            ((ISupportInitialize) this.TxtHoaHong).BeginInit();
            ((ISupportInitialize) this.TxtTienChietKhau).BeginInit();
            ((ISupportInitialize) this.TxtDoanhThu).BeginInit();
            this.Panel1.SuspendLayout();
            this.VSlist.BeginInit();
            this.SuspendLayout();
            this.Label16.AutoEllipsis = true;
            this.Label16.AutoSize = true;
            this.Label16.BackColor = Color.Transparent;
            System.Drawing.Point point = new System.Drawing.Point(0xb8, 4);
            this.Label16.Location = point;
            this.Label16.Name = "Label16";
            this.Label16.RightToLeft = RightToLeft.No;
            Size size = new Size(0x70, 13);
            this.Label16.Size = size;
            this.Label16.TabIndex = 0x72;
            this.Label16.Text = "Nh\x00e2n vi\x00ean kinh doanh";
            this.Label16.TextAlign = ContentAlignment.TopRight;
            this.Label1.AutoSize = true;
            this.Label1.BackColor = Color.Transparent;
            point = new System.Drawing.Point(0x5d, 4);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x35, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 0x3f;
            this.Label1.Text = "Đến ng\x00e0y";
            this.Panel3.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgleft;
            this.Panel3.Controls.Add(this.Panel4);
            this.Panel3.Dock = DockStyle.Bottom;
            point = new System.Drawing.Point(0, 0x240);
            this.Panel3.Location = point;
            this.Panel3.Name = "Panel3";
            size = new Size(0x3e2, 0x20);
            this.Panel3.Size = size;
            this.Panel3.TabIndex = 0x7a;
            this.Panel4.BackColor = Color.Transparent;
            this.Panel4.Controls.Add(this.TxtLaiGop);
            this.Panel4.Controls.Add(this.TxtTienVon);
            this.Panel4.Controls.Add(this.TxtHoaHong);
            this.Panel4.Controls.Add(this.TxtTienChietKhau);
            this.Panel4.Controls.Add(this.TxtDoanhThu);
            this.Panel4.Dock = DockStyle.Right;
            point = new System.Drawing.Point(0x202, 0);
            this.Panel4.Location = point;
            this.Panel4.Name = "Panel4";
            size = new Size(480, 0x20);
            this.Panel4.Size = size;
            this.Panel4.TabIndex = 0x12;
            this.TxtLaiGop.BorderStyle = BorderStyle.FixedSingle;
            this.TxtLaiGop.DataType = typeof(double);
            this.TxtLaiGop.FormatType = FormatTypeEnum.Currency;
            point = new System.Drawing.Point(380, 6);
            this.TxtLaiGop.Location = point;
            this.TxtLaiGop.Name = "TxtLaiGop";
            Padding padding = new Padding(1);
            this.TxtLaiGop.Padding = padding;
            this.TxtLaiGop.ReadOnly = true;
            size = new Size(0x57, 20);
            this.TxtLaiGop.Size = size;
            this.TxtLaiGop.TabIndex = 0x8a;
            this.TxtLaiGop.Tag = null;
            this.TxtLaiGop.TextAlign = HorizontalAlignment.Right;
            this.TxtLaiGop.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtLaiGop.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtLaiGop.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienVon.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTienVon.DataType = typeof(double);
            this.TxtTienVon.FormatType = FormatTypeEnum.Currency;
            point = new System.Drawing.Point(0x123, 6);
            this.TxtTienVon.Location = point;
            this.TxtTienVon.Name = "TxtTienVon";
            padding = new Padding(1);
            this.TxtTienVon.Padding = padding;
            this.TxtTienVon.ReadOnly = true;
            size = new Size(0x57, 20);
            this.TxtTienVon.Size = size;
            this.TxtTienVon.TabIndex = 0x89;
            this.TxtTienVon.Tag = null;
            this.TxtTienVon.TextAlign = HorizontalAlignment.Right;
            this.TxtTienVon.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTienVon.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienVon.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtHoaHong.BorderStyle = BorderStyle.FixedSingle;
            this.TxtHoaHong.DataType = typeof(double);
            this.TxtHoaHong.FormatType = FormatTypeEnum.Currency;
            point = new System.Drawing.Point(0xc9, 6);
            this.TxtHoaHong.Location = point;
            this.TxtHoaHong.Name = "TxtHoaHong";
            padding = new Padding(1);
            this.TxtHoaHong.Padding = padding;
            this.TxtHoaHong.ReadOnly = true;
            size = new Size(0x57, 20);
            this.TxtHoaHong.Size = size;
            this.TxtHoaHong.TabIndex = 0x88;
            this.TxtHoaHong.Tag = null;
            this.TxtHoaHong.TextAlign = HorizontalAlignment.Right;
            this.TxtHoaHong.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtHoaHong.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtHoaHong.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienChietKhau.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTienChietKhau.DataType = typeof(double);
            this.TxtTienChietKhau.FormatType = FormatTypeEnum.Currency;
            point = new System.Drawing.Point(0x71, 6);
            this.TxtTienChietKhau.Location = point;
            this.TxtTienChietKhau.Name = "TxtTienChietKhau";
            padding = new Padding(1);
            this.TxtTienChietKhau.Padding = padding;
            this.TxtTienChietKhau.ReadOnly = true;
            size = new Size(0x55, 20);
            this.TxtTienChietKhau.Size = size;
            this.TxtTienChietKhau.TabIndex = 0x87;
            this.TxtTienChietKhau.Tag = null;
            this.TxtTienChietKhau.TextAlign = HorizontalAlignment.Right;
            this.TxtTienChietKhau.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTienChietKhau.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienChietKhau.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtDoanhThu.BorderStyle = BorderStyle.FixedSingle;
            this.TxtDoanhThu.DataType = typeof(double);
            this.TxtDoanhThu.FormatType = FormatTypeEnum.Currency;
            point = new System.Drawing.Point(5, 6);
            this.TxtDoanhThu.Location = point;
            this.TxtDoanhThu.Name = "TxtDoanhThu";
            padding = new Padding(1);
            this.TxtDoanhThu.Padding = padding;
            this.TxtDoanhThu.ReadOnly = true;
            size = new Size(0x69, 20);
            this.TxtDoanhThu.Size = size;
            this.TxtDoanhThu.TabIndex = 0x86;
            this.TxtDoanhThu.Tag = null;
            this.TxtDoanhThu.TextAlign = HorizontalAlignment.Right;
            this.TxtDoanhThu.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtDoanhThu.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtDoanhThu.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtDenNgay.Format = DateTimePickerFormat.Custom;
            point = new System.Drawing.Point(0x60, 20);
            this.TxtDenNgay.Location = point;
            this.TxtDenNgay.Name = "TxtDenNgay";
            size = new Size(0x55, 20);
            this.TxtDenNgay.Size = size;
            this.TxtDenNgay.TabIndex = 0x3e;
            this.Label13.AutoSize = true;
            this.Label13.BackColor = Color.Transparent;
            point = new System.Drawing.Point(4, 6);
            this.Label13.Location = point;
            this.Label13.Name = "Label13";
            size = new Size(0x2e, 13);
            this.Label13.Size = size;
            this.Label13.TabIndex = 0x3d;
            this.Label13.Text = "Từ ng\x00e0y";
            this.Panel1.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgleft;
            this.Panel1.Controls.Add(this.CmdCancel);
            this.Panel1.Controls.Add(this.CmdExel);
            this.Panel1.Controls.Add(this.CmdPrint);
            this.Panel1.Controls.Add(this.CmdLoad);
            this.Panel1.Controls.Add(this.Label16);
            this.Panel1.Controls.Add(this.AdvNhanVien);
            this.Panel1.Controls.Add(this.Label1);
            this.Panel1.Controls.Add(this.TxtDenNgay);
            this.Panel1.Controls.Add(this.Label13);
            this.Panel1.Controls.Add(this.TxtTuNgay);
            this.Panel1.Dock = DockStyle.Top;
            point = new System.Drawing.Point(0, 0);
            this.Panel1.Location = point;
            this.Panel1.Name = "Panel1";
            size = new Size(0x3e2, 0x2f);
            this.Panel1.Size = size;
            this.Panel1.TabIndex = 0x76;
            this.CmdCancel.DialogResult = DialogResult.Cancel;
            this.CmdCancel.Image = (Image) manager.GetObject("CmdCancel.Image");
            this.CmdCancel.ImageAlign = ContentAlignment.MiddleLeft;
            point = new System.Drawing.Point(910, 0x10);
            this.CmdCancel.Location = point;
            this.CmdCancel.Name = "CmdCancel";
            size = new Size(0x4f, 0x19);
            this.CmdCancel.Size = size;
            this.CmdCancel.TabIndex = 0x76;
            this.CmdCancel.Text = "&Tho\x00e1t";
            this.CmdCancel.UseVisualStyleBackColor = true;
            this.CmdExel.Image = (Image) manager.GetObject("CmdExel.Image");
            this.CmdExel.ImageAlign = ContentAlignment.MiddleLeft;
            point = new System.Drawing.Point(0x2e6, 0x10);
            this.CmdExel.Location = point;
            this.CmdExel.Name = "CmdExel";
            size = new Size(0x53, 0x19);
            this.CmdExel.Size = size;
            this.CmdExel.TabIndex = 0x75;
            this.CmdExel.Text = "&Excel";
            this.CmdExel.UseVisualStyleBackColor = true;
            this.CmdPrint.Image = ACCOUNTING.My.Resources.Resources.report;
            this.CmdPrint.ImageAlign = ContentAlignment.MiddleLeft;
            point = new System.Drawing.Point(0x33a, 0x10);
            this.CmdPrint.Location = point;
            this.CmdPrint.Name = "CmdPrint";
            size = new Size(0x53, 0x19);
            this.CmdPrint.Size = size;
            this.CmdPrint.TabIndex = 0x74;
            this.CmdPrint.Text = "Trang in";
            this.CmdPrint.UseVisualStyleBackColor = true;
            this.CmdLoad.Image = (Image) manager.GetObject("CmdLoad.Image");
            this.CmdLoad.ImageAlign = ContentAlignment.MiddleLeft;
            point = new System.Drawing.Point(0x292, 0x10);
            this.CmdLoad.Location = point;
            this.CmdLoad.Name = "CmdLoad";
            size = new Size(0x53, 0x19);
            this.CmdLoad.Size = size;
            this.CmdLoad.TabIndex = 0x73;
            this.CmdLoad.Text = "Load";
            this.CmdLoad.UseVisualStyleBackColor = true;
            this.AdvNhanVien.Conditions = "";
            this.AdvNhanVien.LoaiDoiTuong = modGeneral.TypeObjects.NhanVien;
            point = new System.Drawing.Point(0xbb, 20);
            this.AdvNhanVien.Location = point;
            this.AdvNhanVien.Name = "AdvNhanVien";
            this.AdvNhanVien.ReadOnly = false;
            size = new Size(0x12e, 20);
            this.AdvNhanVien.Size = size;
            this.AdvNhanVien.TabIndex = 0x71;
            this.AdvNhanVien.UpperText = true;
            this.AdvNhanVien.Value = "";
            this.AdvNhanVien.WidthCode = 80;
            this.TxtTuNgay.Format = DateTimePickerFormat.Custom;
            point = new System.Drawing.Point(7, 20);
            this.TxtTuNgay.Location = point;
            this.TxtTuNgay.Name = "TxtTuNgay";
            size = new Size(0x53, 20);
            this.TxtTuNgay.Size = size;
            this.TxtTuNgay.TabIndex = 60;
            this.VSlist.AllowEditing = false;
            this.VSlist.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.XpThemes;
            this.VSlist.ColumnInfo = manager.GetString("VSlist.ColumnInfo");
            this.VSlist.Dock = DockStyle.Fill;
            this.VSlist.ExtendLastCol = true;
            this.VSlist.FocusRect = FocusRectEnum.None;
            this.VSlist.KeyActionEnter = KeyActionEnum.MoveAcross;
            point = new System.Drawing.Point(0, 0x2f);
            this.VSlist.Location = point;
            this.VSlist.Name = "VSlist";
            this.VSlist.Rows.Count = 1;
            this.VSlist.Rows.DefaultSize = 0x11;
            this.VSlist.Rows.MaxSize = 0x12;
            this.VSlist.Rows.MinSize = 0x12;
            this.VSlist.SelectionMode = SelectionModeEnum.Row;
            size = new Size(0x3e2, 0x211);
            this.VSlist.Size = size;
            this.VSlist.StyleInfo = manager.GetString("VSlist.StyleInfo");
            this.VSlist.TabIndex = 0x77;
            this.VSlist.VisualStyle = C1.Win.C1FlexGrid.VisualStyle.Office2007Blue;
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            size = new Size(0x3e2, 0x260);
            this.ClientSize = size;
            this.Controls.Add(this.VSlist);
            this.Controls.Add(this.Panel3);
            this.Controls.Add(this.Panel1);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.MinimizeBox = false;
            this.Name = "Frm_BaoCaoDoanhThuTheoNhanVien";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Tag = "BC-BH13";
            this.Text = "DOANH THU BAN HANG THEO NHAN VIEN";
            this.Panel3.ResumeLayout(false);
            this.Panel4.ResumeLayout(false);
            ((ISupportInitialize) this.TxtLaiGop).EndInit();
            ((ISupportInitialize) this.TxtTienVon).EndInit();
            ((ISupportInitialize) this.TxtHoaHong).EndInit();
            ((ISupportInitialize) this.TxtTienChietKhau).EndInit();
            ((ISupportInitialize) this.TxtDoanhThu).EndInit();
            this.Panel1.ResumeLayout(false);
            this.Panel1.PerformLayout();
            this.VSlist.EndInit();
            this.ResumeLayout(false);
        }

        public void LoadData()
        {
            System.Data.DataTable data = this.GetData();
            C1.Win.C1FlexGrid.C1FlexGrid vSlist = this.VSlist;
            vSlist.Rows.Count = 1;
            int num2 = data.Rows.Count - 1;
            for (int i = 0; i <= num2; i++)
            {
                vSlist.AddItem("");
                vSlist[i + 1, 0] = RuntimeHelpers.GetObjectValue(data.Rows[i]["TenNhanVien"]);
                vSlist[i + 1, 1] = RuntimeHelpers.GetObjectValue(data.Rows[i]["Ngay"]);
                vSlist[i + 1, 2] = RuntimeHelpers.GetObjectValue(data.Rows[i]["SoChungTu"]);
                vSlist[i + 1, 3] = RuntimeHelpers.GetObjectValue(data.Rows[i]["SoHoadon"]);
                vSlist[i + 1, 4] = RuntimeHelpers.GetObjectValue(data.Rows[i]["KhachHang"]);
                vSlist[i + 1, 5] = RuntimeHelpers.GetObjectValue(data.Rows[i]["MaHang"]);
                vSlist[i + 1, 6] = RuntimeHelpers.GetObjectValue(data.Rows[i]["TenHangHoa"]);
                vSlist[i + 1, 7] = RuntimeHelpers.GetObjectValue(data.Rows[i]["SoLuong"]);
                vSlist[i + 1, 8] = RuntimeHelpers.GetObjectValue(data.Rows[i]["DoanhThu"]);
                vSlist[i + 1, 9] = RuntimeHelpers.GetObjectValue(data.Rows[i]["ChietKhau"]);
                vSlist[i + 1, 10] = RuntimeHelpers.GetObjectValue(data.Rows[i]["HoaHong"]);
                vSlist[i + 1, 11] = RuntimeHelpers.GetObjectValue(data.Rows[i]["TienVon"]);
                vSlist[i + 1, 12] = RuntimeHelpers.GetObjectValue(data.Rows[i]["LaiGop"]);
            }
            this.TxtDoanhThu.Value = LVYModule.SumColGrid(this.VSlist, 8);
            this.TxtTienChietKhau.Value = LVYModule.SumColGrid(this.VSlist, 9);
            this.TxtHoaHong.Value = LVYModule.SumColGrid(this.VSlist, 10);
            this.TxtTienVon.Value = LVYModule.SumColGrid(this.VSlist, 11);
            this.TxtLaiGop.Value = LVYModule.SumColGrid(this.VSlist, 12);
            vSlist.Tree.Column = 4;
            vSlist.Subtotal(AggregateEnum.Sum, 0, 0, 0, 8, "{0}");
            vSlist.Subtotal(AggregateEnum.Sum, 0, 0, 0, 9, "{0}");
            vSlist.Subtotal(AggregateEnum.Sum, 0, 0, 0, 10, "{0}");
            vSlist.Subtotal(AggregateEnum.Sum, 0, 0, 0, 11, "{0}");
            vSlist.Subtotal(AggregateEnum.Sum, 0, 0, 0, 12, "{0}");
            vSlist = null;
        }

        public void PrintReport()
        {
            this.Cursor = Cursors.WaitCursor;
            System.Data.DataTable data = this.GetData();
            if (data.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                Rpt_LaiGopTheoNhanVien vien = new Rpt_LaiGopTheoNhanVien();
                try
                {
                    vien.SetDataSource(data);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        vien.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        vien.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    vien.SetParameterValue(1, modGeneral.Tranlated("Địa chỉ", "") + ": " + modGeneral.H_ADDRESSVIET);
                    vien.SetParameterValue(2, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                    vien.SetParameterValue(3, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                    vien.SetParameterValue(4, modGeneral.Tranlated("DOANH THU NH\x00c2N VI\x00caN KINH DOANH", ""));
                    vien.SetParameterValue(5, modGeneral.Tranlated("Từ ng\x00e0y", "") + " : " + this.TxtTuNgay.Text + " " + modGeneral.Tranlated("Đến ng\x00e0y", "") + " : " + this.TxtDenNgay.Text);
                    vien.SetParameterValue(6, modGeneral.Tranlated("STT", ""));
                    vien.SetParameterValue(7, modGeneral.Tranlated("M\x00e3 h\x00e0ng", ""));
                    vien.SetParameterValue(8, modGeneral.Tranlated("T\x00ean h\x00e0ng", ""));
                    vien.SetParameterValue(9, modGeneral.Tranlated("SL", ""));
                    vien.SetParameterValue(10, modGeneral.Tranlated("Doanh thu", ""));
                    vien.SetParameterValue(11, modGeneral.Tranlated("Chiết khấu", ""));
                    vien.SetParameterValue(12, modGeneral.Tranlated("Hoa hồng", ""));
                    vien.SetParameterValue(13, modGeneral.Tranlated("Tiền vốn", ""));
                    vien.SetParameterValue(14, modGeneral.Tranlated("L\x00e3i gộp", ""));
                    vien.SetParameterValue(15, modGeneral.Tranlated("Tổng cộng", ""));
                    vien.SetParameterValue(0x10, modGeneral.Tranlated("Ng\x00e0y .... th\x00e1ng .... năm ............", ""));
                    vien.SetParameterValue(0x11, modGeneral.Tranlated("Lập biểu", ""));
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = vien;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    this.Cursor = Cursors.Default;
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        private void TxtTuNgay_LostFocus(object sender, EventArgs e)
        {
            if (LVYModule.sRight(this.TxtTuNgay.Text, 7) != LVYModule.sRight(this.TxtDenNgay.Text, 7))
            {
                this.TxtDenNgay.Text = DateTime.DaysInMonth(Conversions.ToInteger(LVYModule.sRight(this.TxtTuNgay.Text, 4)), Conversions.ToInteger(LVYModule.sMid(this.TxtTuNgay.Text, 4, 2))).ToString() + "/" + LVYModule.sRight(this.TxtTuNgay.Text, 7);
            }
        }

        internal virtual ADVObjects AdvNhanVien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvNhanVien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvNhanVien = value;
            }
        }

        internal virtual System.Windows.Forms.Button CmdCancel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdCancel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdCancel_Click);
                if (this._CmdCancel != null)
                {
                    this._CmdCancel.Click -= handler;
                }
                this._CmdCancel = value;
                if (this._CmdCancel != null)
                {
                    this._CmdCancel.Click += handler;
                }
            }
        }

        internal virtual System.Windows.Forms.Button CmdExel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdExel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdExel_Click);
                if (this._CmdExel != null)
                {
                    this._CmdExel.Click -= handler;
                }
                this._CmdExel = value;
                if (this._CmdExel != null)
                {
                    this._CmdExel.Click += handler;
                }
            }
        }

        internal virtual System.Windows.Forms.Button CmdLoad
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdLoad;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdLoad_Click);
                if (this._CmdLoad != null)
                {
                    this._CmdLoad.Click -= handler;
                }
                this._CmdLoad = value;
                if (this._CmdLoad != null)
                {
                    this._CmdLoad.Click += handler;
                }
            }
        }

        internal virtual System.Windows.Forms.Button CmdPrint
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdPrint;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdPrint_Click);
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.Click -= handler;
                }
                this._CmdPrint = value;
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.Click += handler;
                }
            }
        }

        internal virtual System.Windows.Forms.Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual System.Windows.Forms.Label Label13
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label13;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label13 = value;
            }
        }

        internal virtual System.Windows.Forms.Label Label16
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label16;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label16 = value;
            }
        }

        internal virtual Panel Panel1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel1 = value;
            }
        }

        internal virtual Panel Panel3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel3 = value;
            }
        }

        internal virtual Panel Panel4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel4 = value;
            }
        }

        internal virtual DateTimePicker TxtDenNgay
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDenNgay;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDenNgay = value;
            }
        }

        internal virtual C1NumericEdit TxtDoanhThu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDoanhThu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDoanhThu = value;
            }
        }

        internal virtual C1NumericEdit TxtHoaHong
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtHoaHong;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtHoaHong = value;
            }
        }

        internal virtual C1NumericEdit TxtLaiGop
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtLaiGop;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtLaiGop = value;
            }
        }

        internal virtual C1NumericEdit TxtTienChietKhau
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienChietKhau;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTienChietKhau = value;
            }
        }

        internal virtual C1NumericEdit TxtTienVon
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienVon;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTienVon = value;
            }
        }

        internal virtual DateTimePicker TxtTuNgay
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTuNgay;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtTuNgay_LostFocus);
                if (this._TxtTuNgay != null)
                {
                    this._TxtTuNgay.LostFocus -= handler;
                }
                this._TxtTuNgay = value;
                if (this._TxtTuNgay != null)
                {
                    this._TxtTuNgay.LostFocus += handler;
                }
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSlist
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSlist;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._VSlist = value;
            }
        }
    }
}

